import Vue from 'vue'
import VueRouter from 'vue-router'
// mport VueRouter from './router-test'
import Home from './pages/Home'
import About from './pages/About'

Vue.use(VueRouter)

const routes = [
    { 
        path: '/home',
        name: 'home', 
        component: Home 
    },
    { 
        path: '/about', 
        name: 'about',
        component: About 
    }
]

// const routes = [
//     {
//         path: '/',
//         name: 'entry',
//         component: App,
//         children: [
//             { 
//                 path: '/home',
//                 name: 'home', 
//                 component: Home 
//             },
//             { 
//                 path: '/about', 
//                 name: 'about',
//                 component: About 
//             }
//         ]
//     },
// ]

const router = new VueRouter({
    mode: 'hash',
    routes // (缩写) 相当于 routes: routes
})

export default router